// To parse this JSON data, do
//
//     final homeExpertData = homeExpertDataFromJson(jsonString);

import 'dart:convert';

HomeExpertData homeExpertDataFromJson(String str) =>
    HomeExpertData.fromJson(json.decode(str));

String homeExpertDataToJson(HomeExpertData data) => json.encode(data.toJson());

class HomeExpertData {
  HomeExpertData({
    this.id,
    this.audit,
    this.photo,
    this.name,
    this.title,
    this.agent,
    this.pLink,
    this.intro,
    this.createdAt,
    this.updatedAt,
    this.v,
    this.fruit,
    this.researchArea,
  });

  String id;
  int audit;
  String photo;
  String name;
  String title;
  String agent;
  String pLink;
  String intro;
  DateTime createdAt;
  DateTime updatedAt;
  int v;
  String fruit;
  String researchArea;

  factory HomeExpertData.fromJson(Map<String, dynamic> json) => HomeExpertData(
        id: json["_id"],
        audit: json["audit"],
        photo: json["photo"],
        name: json["name"],
        title: json["title"],
        agent: json["agent"],
        pLink: json["p_link"],
        intro: json["intro"],
        createdAt: DateTime.parse(json["createdAt"]),
        updatedAt: DateTime.parse(json["updatedAt"]),
        v: json["__v"],
        fruit: json["fruit"],
        researchArea: json["research_area"],
      );

  Map<String, dynamic> toJson() => {
        "_id": id,
        "audit": audit,
        "photo": photo,
        "name": name,
        "title": title,
        "agent": agent,
        "p_link": pLink,
        "intro": intro,
        "createdAt": createdAt.toIso8601String(),
        "updatedAt": updatedAt.toIso8601String(),
        "__v": v,
        "fruit": fruit,
        "research_area": researchArea,
      };
}
